// 引入 request 文件
import request from './index.js'
// 获取动态列表
export const getpostsList = (id) => {
	return request.get("/api/posts/list", {
		pageNum: id
	});
}

// 发文
export const setpostsList = (data) => {
	return request.post("/api/posts", data);
}

// 获取用户信息
export const getUserDetail = (id) => {
	return request.get("/api/users/" + id);
}

// 登录
export const login = (data) => {
	return request.post("/api/users", data);
}

// 获取动态详细信息
export const getpostsDetail = (id) => {
	return request.get("/api/posts/" + id);
}

// 获取动态详细信息
export const getUserPostsDetail = (id) => {
	return request.get("/api/posts/id/" + id);
}
// 修改用户信息
export const setUserDetail = (data) => {
	return request.post("/api/users/update", data)
}

// 获取动态评论
export const getCommentsDetail = (id) => {
	return request.get("/api/comments/" + id);
}

// 发评论
export const setCommentsDetail = (data) => {
	return request.post("/api/comments", data);
}

// 支付接口
export const payOrders = (data) => {
	return request.post("/api/pay/create/order", data);
}

// 获取礼物接口
export const getGifts = () => {
	return request.get("/api/gifts/list");
}

// 发起提现
export const setWithdraw = (data) => {
	return request.post("/api/withdraw/withdraw", data);
}

// 获取提现列表
export const getWithdrawList = (data) => {
	return request.get("/api/withdraw/withdraw/" + data);
}

// 领取提现接口
export const postWithdraw = (data) => {
	return request.post("/api/pay/withdraw", data);
}

// 获取项目信息
export const getSetings = (data) => {
	return request.get("/api/shop/settings/1");
}

// 上传文件地址
export const uploadUrl = request.url + "/api/upload";